<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/master.xhtml">

        <ui:define name="menu">
            <ui:include src="../menu.xhtml" /> 
        </ui:define>

         <ui:define name="TituloModulo">
            Gestão de Financeira
        </ui:define>
        
                
        <ui:define name="TituloConteudoPrincipal">
            Tipos de Contas
        </ui:define>

        <ui:define name="ConteudoPrincipal">
            
            <p:messages globalOnly="true"/>
            
            <h:form>
                <h:outputText escape="false" value="#{bundle.semDados}" rendered="#{tipoContaController.items.rowCount == 0}"/>
                <h:panelGroup rendered="#{tipoContaController.items.rowCount > 0}">
                    <h:outputText value="#{tipoContaController.pagination.pageFirstItem + 1}..#{tipoContaController.pagination.pageLastItem + 1}/#{tipoContaController.pagination.itemsCount}"/>&nbsp;
                    <p:commandButton action="#{tipoContaController.previous}" value="#{bundle.anterior} #{tipoContaController.pagination.pageSize}" rendered="#{tipoContaController.pagination.hasPreviousPage}"/>&nbsp;
                    <p:commandButton action="#{tipoContaController.next}" value="#{bundle.posterior} #{tipoContaController.pagination.pageSize}" rendered="#{tipoContaController.pagination.hasNextPage}"/>&nbsp;
                    <p:dataTable value="#{tipoContaController.items}" var="item" >
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.nomeTipoConta}"/>
                            </f:facet>
                            <h:outputText value="#{item.nomeTipoConta}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="&nbsp;"/>
                            </f:facet>
                             <p:menuButton value="Opções">

                                <p:menuitem value="#{bundle01.ver}"  
                                            action="#{tipoContaController.prepareView}" 
                                            icon="ui-icon-extlink" ajax="false"/>

                                <p:menuitem value="#{bundle01.editar}" ajax="false"   
                                            action="#{tipoContaController.prepareEdit}"  
                                            icon="ui-icon-arrowrefresh-1-w" />

                                <p:menuitem value="#{bundle01.eliminar}" icon="ui-icon-close"  
                                             ajax="false"  action="#{tipoContaController.destroy}"/>
                            </p:menuButton>
                        </p:column>
                    </p:dataTable>
                </h:panelGroup>
                <p:commandButton action="#{tipoContaController.prepareCreate}" value="#{bundle.criar}" ajax="false" />

            </h:form>
        </ui:define>
    </ui:composition>

</html>
